%table#app-resources-table
  %tbody
    %tr
      %td{:width => "20%"}=t('apps.resources.name')
      %td= @name
    %tr
      %td=t('apps.resources.state')
      %td= colorize_state(@app[:state]).html_safe
    %tr
      %td=t('apps.resources.health')
      %td= health(@app).html_safe
    %tr
      %td=t('apps.resources.instances')
      %td.editableText{:id => "instances-" + @name}= @app[:instances]
    %tr
      %td=t('apps.resources.memory')
      %td.editableText{:id => "memory-" + @name}= pretty_size(@app[:resources][:memory] * 1024 * 1024, 0)
    %tr
      %td=t('apps.resources.disk')
      %td= pretty_size(@app[:resources][:disk] * 1024 * 1024, 0)
    %tr
      %td=t('apps.resources.framework')
      %td= find_vendor_image(@app[:staging][:model]).html_safe
    %tr
      %td=t('apps.resources.runtime')
      %td= find_vendor_image(@app[:staging][:stack]).html_safe

- content_for :javascripts do
  :javascript
    $(function() {
      resources_appname = '#{@name}';
      resources_instances = #{@app[:instances]};
      resources_available_instances = #{@available_instances};
      resources_available_memsizes = #{@available_memsizes.to_json};
      app_set_instances_url = '#{app_set_instances_url}.js';
      app_set_memsize_url = '#{app_set_memsize_url}.js';
    });